const {ccclass, property} = cc._decorator;
@ccclass
export default class EventListener extends cc.Component {

    _finishEvent = [];

    addEvent(key: string, func: Function) {
        this._finishEvent[key] = func;
    };

    removeEvent(key: string) {
        this._finishEvent[key] = null;
    };

    ptachEvent(key:string,param:any){
        if(this._finishEvent[key] != null){
            let func = this._finishEvent[key];
            func(param);
        }
    };

}
